﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Web;

namespace HepsiBuradaXml
{
    public static class Eklenti
    {
        public static string ReadString(this SqlDataReader rd, string alanAdi)
        {
            string sonuc = "";
            object deger = rd[alanAdi];
            if (deger != DBNull.Value && deger != null)
            {
                if (deger is double || deger is decimal)
                {
                    sonuc = deger.ToString().Replace(',', '.');
                }
                else
                {
                    sonuc = deger.ToString();
                }
            }
            return sonuc;
        }
    }
}